<title>交易明细</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<script type="text/javascript" src="#(assets)/js/jquery-2.2.4.min.js"></script>
<link rel="stylesheet" href="#(assets)/css/common.css" type="text/css" />
<link href="#(assets)/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
<script src="#(assets)/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="#(assets)/js/date.js" ></script>
<script type="text/javascript" src="#(assets)/js/iscroll.js" ></script>
<script type="text/javascript" src="#(path)/assets/js/jquery.tmpl.min.js"></script> 
#@checkToken() 

<script type="text/javascript">
$(function(){
	$('#beginTime').date();
	$('#endTime').date({theme:"datetime"});
});
</script>
<style> 
	body{font-family:"Microsoft YaHei",Arial,Helvetica,sans-serif,"宋体";}
	*{margin:0;padding:0;}
	li{list-style-type:none;}
	select,input{-webkit-appearance:none;border:0px;
		-webkit-tap-highlight-color: rgba(0, 0, 0, 0);   
	}
	#dateconfirm{background:#fa3048;color:#FFF;}
	#datetitle{background:#fa3048;color:#FFF;}
	#datecancle{color:#FFF} 
</style>
<body bgcolor="#fff" style="margin:0px;">
	<div align="center" style="width:100%;height:100px;">
		<div align="center" style="background:#FFF;width:90%;height:50px;">
			<div onclick="window.location.href='/app/page/personal-transaction';" style="margin-right:5%;line-height:40px;float:left;width:30%;height:40px;;border-bottom:2px solid #fa3048;color:#fa3048"> 
				<a style="font-size:16px;">收支明细</a>
			</div>
			<div onclick="window.location.href='/app/page/personal-rechinfo';" style="margin-right:5%;line-height:40px;float:left;width:30%;height:40px"> 
				<a style="font-size:16px;">充值明细</a>
			</div>
			<div onclick="window.location.href='/app/page/personal-cashinfo';" style="line-height:40px;float:right;width:30%;height:40px;"> 
				<a style="font-size:16px;">提取明细</a>
			</div>
		</div>
		<div align="center" style="clear:both;width:90%;height:40px;line-height:40px;background:#FFF;">
			<div align="center"  style="float:left;width:40%">
				<input style="background:url(#(assets)/images/mobile/transaction_riqi.png) right 10px center no-repeat;background-size:20px 20px; border-radius:5px;width:100%;border:1px solid #e8e8e8;height:30px;margin-top:5px;padding-left:10px;"  id="beginTime"  />
			</div>
			<div align="center"  style="float:left;margin-left:10px;width:40%;">
				<input style="background:url(#(assets)/images/mobile/transaction_riqi.png) right 10px center no-repeat;background-size:20px 20px;border-radius:5px;width:100%;border:1px solid #e8e8e8;height:30px;margin-top:5px;padding-left:10px;" id="endTime"  />
			</div>
			<div id="maketrue" align="center"  style="float:right;width:15%;"><input value="搜索" type="button" style="border-radius:5px;padding-left:0px;width:100%;border:1px solid #aaa;height:30px;margin-top:5px;" /></div>
			<!--<div id="maketrue" align="center"  style="float:left;width:20%;margin-left:5%;margin-right:5%;"><input value="确定" type="button" style="border-radius:5px;padding-left:0px;width:100%;border:1px solid #aaa;height:30px;margin-top:5px;" /></div>-->
		</div>
		<div id="datePlugin"></div>
	</div>
	<div style="width:100%;height:10px;background:#f4f5f9"></div>
	<div id="alllist" align="center" style="padding-bottom:20px;"></div>
	<div id="showlists"></div>	
	
 
<script id="demo" type="text/x-jquery-tmpl">
	<div onclick="window.location.href='#(path)/app/page/personal-tradeinfo?id=${id}'" style="border-bottom:1px solid #f0f0f0">
		<div style="width:90%;height:40px;padding:10px 0 10px;">
			<div>
				<div style="float:left;color:#626262">${type}</div>
				<div style="float:right;">${fuhao} ${amount}</div>
			</div>
			<div style="color:#626262;font-size:13px;clear:both">
				<div style="float:left;">${create_time}</div>
				<div style="float:right;color:#fa3048">${status}</div> 
			</div>
		</div> 
	</div> 
</script>

<script type="text/javascript" src="/assets/dropload/dropload.min.js"></script>
<link rel="stylesheet" href="/assets/dropload/dropload.css">

<script>
var page = 0;
$('#alllist').dropload({
	scrollArea : window,
	loadDownFn : function(me){
		page++; 
		var createTimeStart = $("#beginTime").val();
		var createTimeEnd = $("#endTime").val();
		var url = "#(path)/investLog/myList?token=#(session.token??)&size=10&page="+page+"&createTimeStart=" + createTimeStart + "&createTimeEnd=" + createTimeEnd;
		$.getJSON(url, function(datalist) {
			console.log(datalist);
			$.each(datalist.data.page.list, function(i, item){ 
				var type = "";
				if(item.type=="trade"){
					type="投资";
				}else if(item.type=="amount"){ 
					type="回款";
				}else if(item.type=="share"){
					type="分润";
				}else if(item.type=="deposit"){
					type="充值";
				}else if(item.type=="withdraw"){
					type="提现";
				}else if(item.type=="withdraw_fee"){
					type="提现手续费";
				}else if(item.type=="deposit_fee"){
					type="充值手续费";
				}
				if(item.mode=="sub"){ 
					var fuhao = "-";
				}else if(item.mode=="add"){
					var fuhao = "+";
				}
				if(item.status=="success"){
					var status = "成功";
				}else if(item.status=="process"){
					var status = "进行中";
				}else if(item.status=="failed"){
					var status = "失败";
				}
				var invests = {id:item.id,status:status,type:type,create_time:item.create_time,amount:item.amount,fuhao:fuhao};
				$("#demo").tmpl(invests).appendTo('#alllist');
			});
			$(".dropload-down").css("height","0px"); 
			if(!datalist.data.page.lastPage){
				me.resetload();	
			}
		});	
	}
});	
$("#maketrue").click(function(){
	$("#alllist").empty();
	var page = 0;
	$('#alllist').dropload({
		scrollArea : window,
		loadDownFn : function(me){
			page++; 
			if($("#beginTime").val()==""){
				var createTimeStart ="";
			}else{
				var createTimeStart = $("#beginTime").val() + " 00:00:00";
			}
			if($("#endTime").val()==""){
				var createTimeEnd ="";
			}else{
				var createTimeEnd = $("#endTime").val() + " 23:59:59";
			}
			var url = "#(path)/investLog/myList?token=#(session.token??)&size=10&page="+page+"&createTimeStart=" + createTimeStart + "&createTimeEnd=" + createTimeEnd;
			$.getJSON(url, function(datalist) {
				console.log(datalist);
				$.each(datalist.data.page.list, function(i, item){ 
					var type = "";
					if(item.type=="trade"){
						type="投资";
					}else if(item.type=="amount"){ 
						type="回款";
					}else if(item.type=="share"){
						type="分润";
					}else if(item.type=="deposit"){
						type="充值";
					}else if(item.type=="withdraw"){
						type="提现";
					}else if(item.type=="withdraw_fee"){
						type="提现手续费";
					}else if(item.type=="deposit_fee"){
						type="充值手续费";
					}
					if(item.mode=="sub"){ 
						var fuhao = "-";
					}else if(item.mode=="add"){
						var fuhao = "+";
					}
					if(item.status=="success"){
						var status = "成功";
					}else if(item.status=="process"){
						var status = "进行中";
					}else if(item.status=="failed"){
						var status = "失败";
					}
					var invests = {id:item.id,status:status,type:type,create_time:item.create_time,amount:item.amount,fuhao:fuhao};
					$("#demo").tmpl(invests).appendTo('#alllist');
				});
				$(".dropload-down").css("height","0px"); 
				if(!datalist.data.page.lastPage){
					me.resetload();	
				}
			});	
		}
	});	
});		
</script> 


</body>